<?php
namespace Wj\Encipher;
use Wj\Encipher\Asymmetric\Hash;
use Wj\Encipher\Symmetric\Openssl as BaseOpenssl;
class OpenSSL extends BaseOpenssl {
    /**
     * 设置key
     *
     * @param  string $key
     * @return void
     * @author wj
     * @date 2024-11-09
     */
    public function setkey(string $key) {
        if (empty($key)) {
            throw new \Throwable("set key error");
        }
        $this->key = $key;
    }
    /**
     * 获取key
     *
     * @return void
     * @author wj
     * @date 2024-11-09
     */
    public function getkey() {
        $hash = new Hash();
        $key = $hash->generatesecret();
        return $key;
    }
}